package com.tsc.design.responsibilityMode.example1;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: chentl
 * @Date: 2025/09/17/18:49
 * @Description:
 */
public class DepartmentManager extends LeaveHandler{

    @Override
    public String handleRequest(LeaveRequest request) {
        if (request.getLeaveDays() > 3 && request.getLeaveDays() <= 7) {
            return String.format("部门经理批准了%s的%d天请假申请，理由：%s",
                    request.getEmployeeName(),
                    request.getLeaveDays(),
                    request.getReason());
        } else if (nextHandler != null){
            return nextHandler.handleRequest(request);
        } else {
            return "请假申请无人处理";
        }
    }
}
